package test;


import java.util.LinkedList;
import java.util.List;

public class Solution {
    public static void main(String[] args) {
        int length = args.length;
        for (int i = 0; i < length; i++) {

        }
//        int n = Integer.parseInt(args[0]);
        int n = 1000;
        int m = 1000;
        String china = "零一二三四五六七八九";
        String chinaNmb = "十百千万十百千亿";
        //String china = "\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d";
        //String chinaNmb = "\u5341\u767e\u5343\u4e07\u5341\u767e\u5343\u4ebf";
        StringBuilder sb = new StringBuilder();
        List<Character> list = new LinkedList<Character>();
        do {
            list.add(china.charAt(n % 10));
            n /= 10;
        } while (n > 0);

        int size = list.size() - 1;
        for (int i = size; i >= 0; i--) {
            if (i >= 4) {
                if (list.get(i).toString().equals("零")) {
//                    System.out.print(list.get(i));
                    sb.append(list.get(i));
                } else {
//                    System.out.print(list.get(i) + String.valueOf(chinaNmb.charAt(i-1)));
                    sb.append(list.get(i) + String.valueOf(chinaNmb.charAt(i - 1)));
                }
            } else {
                if (list.get(i).toString().equals("零")) {
//                    System.out.print(list.get(i));

                    sb.append(list.get(i));
                } else {
                    if (i == 0) {
//                        System.out.print(list.get(i));
                        sb.append(list.get(i));
                    } else {
//                    System.out.print(list.get(i) + String.valueOf(chinaNmb.charAt(i)));
                        sb.append(list.get(i) + String.valueOf(chinaNmb.charAt(i - 1)));
                    }
                }
            }
        }
        String s = sb.toString();
        if (m == 100 || m == 1000) {
            System.out.print(s.replace("零", ""));
        } else {
            System.out.print(s);
        }

    }
}



